import { getActicleStates } from '/src/api/provideEnd'

export default {
  namespaced: true,

  state: {
    stateList: [],
  },

  actions: {
    async getActicleStates({ commit }) {
      const res = await getActicleStates()
      const data = res.data.data || []
      commit('SET_STATE_LIST', data)
    },
  },

  mutations: {
    SET_STATE_LIST(state, data) {
      state.stateList = Object.freeze(data)
    },
  },

  getters: {
    stateList: (state) => state.stateList
  }
}
